import http from '@/utils/http'

/**
 * 添加地址信息
 * @param {*} data
 * @returns
 */
export const addMemberAddressAPI = data => {
  return http({
    url: '/member/address',
    method: 'POST',
    data
  })
}

/**
 * 获取所有地址信息
 * @returns
 */
export const getMemberAddressAPI = () => {
  return http({
    url: '/member/address'
  })
}

// 获取修改地址信息
export const getEditMemberAddressAPI = id => {
  return http({
    url: `/member/address/${id}`
  })
}
// 修改地址信息
export const editMemberAddressAPI = (id, data) => {
  return http({
    url: `/member/address/${id}`,
    method: 'PUT',
    data
  })
}

/**
 * 删除收货地址
 * @param {*} id
 * @returns
 */
export const delMemberAddressAPI = id => {
  return http({
    url: `/member/address/${id}`,
    method: 'DELETE'
  })
}
